#include "drve_led.h"
#include "drv_systick.h"
#include "drv_beep.h"
#include "drv_key.h"
#include "drv_exit.h"
#include "drv_usart.h"
#include "drv_time.h"
#include "drv_sht20.h"
#include "drv_iic.h"
#include "drv_seg.h"
#include "drv_dma.h"
//static uint8_t key_status1=0;
//static uint8_t key_status2=0;
//static uint8_t key_status3=0;
//static uint8_t key_statusu=0;
//uint8_t dir1=0;
//uint8_t dir2=0;
//uint8_t dir3=0;
//uint16_t fan_pwm1=0;
//uint16_t fan_pwm2=0;
//uint16_t fan_pwm3=0;
uint8_t i=0;
uint8_t s=0;
int main (void)
{    
	drv_systick_init(168);
	NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2);
	drve_led_int_u();
	drve_led_int1();
	drve_led_int2();
	drve_led_int3();
	drv_key_int_u();
	drv_key_int1();
	drv_key_int2();
	drv_key_int3();
	beep_init();
	drv_sht20_init();
	drv_sht20_rest();
	drv__exit9_int();
	drv_time3_init();
	drv_usart6_init();
	drv_74hc595_init();

	uint32_t dma_src[10]={0x11111111,0x11111112,0x11111113,0x11111114,0x11111115,0x11111116,0x11111117,0x11111118,0x11111119,0x11111110} ;
	uint32_t dma_drc[10]={0};
//	drv_seg_display(0,0);
	//drv_time7_init();
		drv_dma_init(10,dma_src,dma_drc);
	//beep_on();
   printf("HelloNIU\r\n");
   //drv_seg_display(0,0);
	//drv_seg_display(1,1);
	//drv_seg_display(2,2);
	//drv_seg_display(3,3);
	while(1)
	{   
		uint16_t data = drv_sht20_getdata();
		int i;
		for(i=0;i<1000;i++)
		{
			drv_seg_display(data);
		}
//		drv_seg_display(0,0);
//		drv_systick_ms(1000);
	  //drv_seg_display(0,0);	
//		drv_sht20_getdata();
		//drv_systick_ms(1);
	
}
}





